//***********************************************************************
//	File:		ConfusionGas.cpp
//	Author:		
//	Course:		SGP 1405
//	Purpose:	
//***********************************************************************
//***********************************************************************
//	Purposfully left blank for all comments regarding this file 
//	
//	
//	
//***********************************************************************



#include "ConfusionGas.h"

#include "../Message/DestroyEntityMessage.h"


ConfusionGas::ConfusionGas(float posX, float posY, Entity* owner)
{
	SetEffectRadius(150); 
	//SetImage(); 
	SetLifespan(4); 
	SetLifespanTimer(0);
	//SetParticleEffect();
	SetPosition(SGD::Point{ posX, posY }); 
	SetRotation(0);
	SetSize(SGD::Size{ 4, 4 });
	SetVelocity(SGD::Vector{ 0, -1 }); 

}

void ConfusionGas::Update(float dt)
{

	SGD::Event* pConfuse = new SGD::Event("CONFUSE_GAS", nullptr, this);
	pConfuse->QueueEvent();

	SetLifespanTimer(GetLifeSpanTimer() + dt); 
	if (GetLifeSpanTimer() > GetLifeSpan())
	{
		DestroyEntityMessage* pEntityToDestroy = new DestroyEntityMessage(this); 
		pEntityToDestroy->QueueMessage(); 
	}

	//End of function
	Entity::Update(dt);
}

void ConfusionGas::Render(void)
{

}

void ConfusionGas::HandleCollision(const IEntity* pOther)
{

}

void ConfusionGas::HandleEvent()
{

}

SGD::Rectangle ConfusionGas::GetRect() const
{
	return SGD::Rectangle
	{
		GetPosition() - GetSize() / 2, 
		GetPosition() + GetSize() / 2
	};
}